﻿// -----------------------------------------------------------------------
// <copyright file="BaseFormModel.cs" company="Storytelling">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------
namespace Storytelling.Modelos
{
    using System;
    using System.Collections.Generic;
    using System.Reflection;
    using Storytelling.Entidades;
    using Storytelling.Utils;
    using System.Linq.Expressions;

    public abstract class BaseFormModel
    {
        private IList<KeyValuePair<string, long>> lixeira;

        public BaseFormModel()
        {
            lixeira = new List<KeyValuePair<string, long>>();
        }

        public IList<KeyValuePair<string, long>> Lixeira
        {
            get { return lixeira; }
        }

        public string[] LixeiraEntidade
        {
            get { return new string[0]; }
            set 
            {
                foreach (var item in value)
                {
                    string[] lixo = item.Split(new char[] { '_' }, StringSplitOptions.RemoveEmptyEntries);
                    lixeira.Add(new KeyValuePair<string, long>(lixo[0], Int64.Parse(lixo[1])));
                }
            }
        }
    }
}
